<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>

    <script src="https://unpkg.com/vue"></script>
    <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.1.1/vuex.min.js"></script> -->
    <style>
      div {
        margin: 1em;
      }
      div.test:hover {
        background-color: var(--bg-hover-color);
        font-size: var(--hover-font-size);
      }
      div.test:hover::after {
        margin-left: 1em;
        content: var(--hover-content);
      }
    </style>
  </head>
  <body>
    <div id="app" :style="cssProps">
      <div>Hover text: <input type="text" v-model="hoverContent" /></div>
      <div>Hover color: <input type="color" v-model="bgHoverColor" /></div>
      <div class="test">Hover over me</div>
    </div>
    <script>
      new Vue({
        el: "#app",
        data: function() {
          return {
            baseFontSize: 1,
            bgHoverColor: "#ffffff",
            hoverContent: "Hovering!"
          };
        },
        computed: {
          cssProps() {
            return {
              "--hover-font-size": this.baseFontSize * 2 + "em",
              "--bg-hover-color": this.bgHoverColor,
              "--hover-content": JSON.stringify(this.hoverContent)
            };
          }
        }
      });
    </script>
  </body>
</html>
